Repository navigation
feat(exec-broker): extend fs write-scope to a path list (reconciliation R1) - #308
Merged
Merged
Conversation
…on R1) First reconciliation step (kit-research #32): the profile's [scope].fs is a path LIST but the exec-broker's BrokerPolicy.fs was a single root. Extend it to represent a list so the signed profile scope (next step) maps faithfully: - BrokerPolicy.fs gains an optional roots[] alongside the required root; the effective allowed set is [root, ...roots] (policyFsRoots helper, de-duplicated). root stays required so the existing .kit-exec-broker.json shape and all existing tests are unaffected (non-breaking). - loadBrokerPolicy validates roots fail-closed (any non-string[] → null). - collectDenials: an fs write is allowed iff SOME allowed root passes BOTH the pure traversal gate AND the symlink-aware realpath gate; denied only when every root rejects it. Pure/loader change, no behavior change for single-root policies. Tests: validator accepts roots; brokerExec allows a write under any listed root, denies one under none. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
|
✅ Docker image built successfully
|
This was referenced Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
First step of the exec-broker reconciliation (design:
kit-research/docs/research/pillar3-broker-reconciliation-5.0.md, #32). The profile's[scope].fsis a path list, but the existingBrokerPolicy.fswas a singleroot. This extends the fs model to represent a list so the signed profile scope (next PR) can map onto the canonicalexec-brokerfaithfully — no lossy mapping.Type of Change
Related Issues
Changes Made
src/exec-broker/policy.ts:BrokerPolicy.fsgains an optionalroots: string[]alongside the requiredroot; the effective allowed set is[root, ...roots](newpolicyFsRootshelper, de-duplicated).rootstays required, so the existing.kit-exec-broker.jsonshape and every existing test are unaffected (non-breaking).loadBrokerPolicyvalidatesrootsfail-closed (any non-string[]→null).src/exec-broker/broker.ts—collectDenials: an fs write is allowed iff some allowed root passes both the pure traversal gate and the symlink-aware realpath gate; denied only when every root rejects it.Testing
Test Coverage
roots; multi-root allow/deny inbrokerExec)npm test) — full suite 2713 pass / 0 fail (2712 baseline + 1 net)Manual Testing
npx tsc --noEmit→ clean;npx eslint src→ 0 errors.npm run build && node scripts/test.mjs→ 2713 pass, 0 fail.Breaking Changes
None / N/A —
rootremains required;rootsis additive; single-root policies behave identically.Checklist
npm test)Performance Impact
Reviewer Notes
Pure foundation change with no behavior difference for existing single-root policies — the multi-root path only activates when a policy supplies
roots(which today nothing does; the signed-profile provider in R2 will be the first producer). The symlink-aware realpath check is preserved per-root. Next: R2 adds theverifiedScope → BrokerPolicyprovider and therunBrokeredprecedence (signed profile →.kit-exec-broker.json→ passthrough).🤖 Generated with Claude Code
https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
Generated by Claude Code